package com.odobenus.conf;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.odobenus.zk.ZooKeeperServiceDiscovery;

@Configuration
public class OdobenusConfig {

	@Value("${odobenus.zookeeperAddress}")
	private String zookeeperAddress;

	@Bean
	public ZooKeeperServiceDiscovery zooKeeperServiceDiscovery() {
		return new ZooKeeperServiceDiscovery(zookeeperAddress);
	}

	@Bean
	public ObjectMapper objectMapper() {
		return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
	}
}
